package net.xiduth.game.player.dialogues.armour.torva;

import net.xiduth.game.player.dialogues.Dialogue;

public class BrokenTorvaHelm extends Dialogue {

	@Override
	public void start() {
		sendDialogue("Would you like to repair your Broken Torva Helm for 20M?");
		stage = 1;
	}

	@Override
	public void run(int interfaceId, int componentId) {
		if (stage == 1) {
			sendOptionsDialogue("Repair for 20M?", "Yes please.", "No thanks.");
			stage = 2;

		} else if (stage == 2) {
			if (componentId == OPTION_1) {

				if (player.getMoneyInPouch() < 20000000) {
					player.getPackets()
							.sendGameMessage(
									"Please come back when you have enough coins in your pouch.");
					end();
				} else {
					int value = 20000000;
					player.getMoneyPouch().remove(value);
					player.getInventory().deleteItem(995, 20000000);
					player.getInventory().deleteItem(20138, 1);
					player.getInventory().addItem(20135, 1);
					end();
				}
			}

			if (componentId == OPTION_2) {
				end();
			}
		}
	}

	@Override
	public void finish() {
		// TODO Auto-generated method stub

	}

}
